package net.bw.realtime.jtp.mapper;

import net.bw.realtime.jtp.bean.TrafficKeywordReport;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/*
 * @author liuyawei
 * @date 2025/5/24
 */
@Mapper
public interface TrafficKeywordStatsMapper {

    @Select("SELECT\n" +
            " keyword,\n" +
            " sum(keyword_count) AS keyword_count\n" +
            "FROM jtp_log_report.dws_traffic_search_keyword_window_report\n" +
            "WHERE toDate(window_start_time) = #{date}\n" +
            "GROUP BY keyword")
    List<TrafficKeywordReport> selectKeywordCount(@Param("date") String date);

}
